<!DOCTYPE html>
<html>
    <head>
    <style type="text/css">
        #div1{
            width: 200px;
            height: 200px;
            background-color: yellow;
            position: relative;
            top: 50px;
            left: 50px;
            z-index: 1;/*使用zindex 更改div1的层叠关系*/
            }
        #div2{
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
            top: 0px;
            left: 100px;
            }
    </style>
    </head>
<body>
    <div id="div1">进行了相对定位的元素div1</div><div id="div2">后来居上的定位元素div2</div>
    </body>
    <html>
    